/**
 * 
 */
package com.zeba;

import com.zeba.buysell.BuySellActivity;
import com.zeba.fundtransfer.FundTransferActivity;
import com.zeba.help.HelpActivity;
import com.zeba.orderbook.OrderBookActivity;
import com.zeba.portfolio.PortfolioActivity;
import com.zeba.watchlist.WatchlistActivity;

import android.app.Activity;
import android.content.Intent;

/**
 * @author Zeba
 *
 */
public class DashboardActivityTransitionManager {

	public static enum DashboardActivityMap{ 
		DASHBOARD(0),
		BUY_SELL(1),  
		PORTFOLIO_MANAGER(2),  
		ORDER_BOOK(3),  
		FUND_TRANSFER(4),  
		WATCHLIST(5),  
		HELP(6);  

		private final int id;

		DashboardActivityMap(int id){  
			this.id = id;  
		}  
		public int id(){  
			return this.id;  
		} 
		
		public static DashboardActivityMap getEnum(int id){
			
			switch(id){
			case 1:
				return BUY_SELL;
			case 2:
				return PORTFOLIO_MANAGER;
			case 3:
				return ORDER_BOOK;
			case 4:
				return FUND_TRANSFER;
			case 5:
				return WATCHLIST;
			case 6:
				return HELP;
			default:
				return DASHBOARD;
			}
		}
		
	}
	
	public static Intent getIntent(DashboardActivityMap id, Activity caller){
		
		Intent intent = null;
		switch(id){
		case BUY_SELL:
			intent = new Intent(caller, BuySellActivity.class);
			break;
		case FUND_TRANSFER:
			intent = new Intent(caller, FundTransferActivity.class);
			break;
		case HELP:
			intent = new Intent(caller, HelpActivity.class);
			break;
		case ORDER_BOOK:
			intent = new Intent(caller, OrderBookActivity.class);
			break;
		case PORTFOLIO_MANAGER:
			intent = new Intent(caller, PortfolioActivity.class);
			break;
		case WATCHLIST:
			intent = new Intent(caller, WatchlistActivity.class);
			break;
		case DASHBOARD:
		default:
			intent = new Intent(caller, HomeDashboardActivity.class);
		}
		return intent;

	}
}
